package com.googlecode.grima.base;

public class Message {

	public static final String SUCCESS = "success";
	public static final String ERROR = "error";
	public static final String WARNING = "warning";
	public static final String INFO = "info";

	private String type;
	private String title;
	private String content;

	public Message(String type, String title, String content) {
		this.type = type;
		this.title = title;
		this.content = content;
	}

	public String getType() {
		return type;
	}

	public void setType(String type) {
		this.type = type;
	}

	public String getContent() {
		return content;
	}

	public void setContent(String content) {
		this.content = content;
	}

	public String getTitle() {
		return title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	public String getIcon() {
		String ret = "<div class=\"messager-icon messager-info\"></div>";
		
		if (SUCCESS.equals(this.type)) {
			ret = "<div class=\"messager-icon messager-success\"></div>";
			
		} else if (WARNING.equals(this.type)) {
			ret = "<div class=\"messager-icon messager-warning\"></div>";
		
		} else if (ERROR.equals(this.type)) {
			ret = "<div class=\"messager-icon messager-error\"></div>";
		}
		return ret;
	}
}
